import request from "@/request/request.js";

// 登录信息
export const login = (data) => {
  return request.post("/admin-api/system/auth/login", data);
};

// 获取租户id
export const getTenantIdByName = (name) => {
  return request.get(`/admin-api/system/tenant/get-id-by-name?name=${name}`);
};
// 获取用户角色信息
export const getPermissionInfo = () => {
  return request.get(`/admin-api/system/auth/get-permission-info`);
};

// 获取入库信息列表
export const getInventoryList = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/page?${data}`);
};

// 入库详情获取
export const getInventoryData = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/get?${data}`);
};

// 详情里的列表
export const getInventoryListData = (data) => {
  return request.get(
    `/admin-api/inventory/inbound-apply/get-bill-list-by-id?${data}`
  );
};

// 删除
export const deleteInventory = (data) => {
  return request.del(`/admin-api/inventory/inbound-apply/delete?${data}`);
};

// 确认受理
export const confirmAcceptance = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/receive?${data}`);
};

// 设备名称查询
export const getDeviceName = (data) => {
  return request.get(
    `/admin-api/device/information/page?pageNo=1&pageSize=10&${data}`
  );
};

// 生成质检
export const generateQuality = (data) => {
  return request.post(`/admin-api/quality/check-bill/create`, data);
};

// 生成容器
export const generateContainer = (data) => {
  return request.get(
    `/admin-api/inventory/inbound-apply/make-bill-container?${data}`
  );
};

// 拆分
// id=364&quantity=1
export const splitBill = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/split-bill?${data}`);
};

// 接收确认完成
export const confirmCheckReady = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/check-ready?${data}`);
};

// 点击入库完成
export const inboundFinish = (data) => {
  return request.get(`/admin-api/inventory/inbound-apply/finish?${data}`);
};

// 扫码确认接收容器
export const applyReceiveConfirm = (data) => {
  return request.post(
    `/admin-api/inventory/inbound-apply/apply-receive-confirm`,
    data
  );
};
